package com.molin.threadTest.blockingQueueTest;

import java.util.concurrent.ArrayBlockingQueue;

public class Cooker extends Thread {
    ArrayBlockingQueue<String> list;
    public Cooker(ArrayBlockingQueue<String> list) {
        this.list=list;
    }

    @Override
    public void run() {
        while (true) {
            System.out.println("厨子做汉堡");
            try {
                list.put("汉堡包");
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
